package com.hqyj.springCloudAccount.service;

import com.hqyj.entity.test.City;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author yun
 * @date 2021-5-12 10:22
 */
@FeignClient(name = "client-test")//这里的name是被调用的服务器的唯一标识
@Component
@RequestMapping("/api/test")
public interface TestOpenFeignClient {

    //无须写dao层接口直接通过FeignClient调用第三方写好的接口
    @GetMapping("/city/{cityId}")
    City getCityByCityId(@PathVariable int cityId);
}
